/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.itsc.dswII.view;

import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import mx.its.dswII.biblioteca.bl.LibroBLLocal;
import mx.its.dswII.biblioteca.modelo.Libro;

/**
 *
 * @author Lenovo-user
 */
@ManagedBean
@SessionScoped
public class AccessBean {

    private String user = "";
    private String pass = "";

    public AccessBean() {
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }
    //++++++++Action++++

    public String procesarAccion() {

        if (user.equals("root") && pass.equals("12345")) {
            FacesContext context = FacesContext.getCurrentInstance();
            context.getExternalContext().getSessionMap().put("USUARIO_LOGUEADO", user);
            return "PrincipalMenu";
        } else {
            return "pagina2";
        }
    }
}
